# !usr/bin/env python
# -*- coding:utf-8 _*-
"""
@Author:张广勤
@Web site: https://www.tunan.wang
@Github:www.github.com
 
@File:gongbao_qg1_0.py
@Time:2024/9/4 15:22

@Motto:不积跬步无以至千里，不积小流无以成江海！
"""
from gongbao_quanguo.gongbao_sx4_0 import url2docx
from gongbao_quanguo.url2list import url_list,extract_reports

base_url = 'https://www.stats.gov.cn/sj/tjgb/ndtjgb/qgndtjgb/'
num_pages = 4  # 总页数

urls = url_list(base_url,num_pages)
for url in urls:
    article_list = extract_reports(base_url,url)
    # print(article_list)
    for article in article_list:
        # print(article[0],article[1])
        url2docx(article[1])
